package databasetest.zx.com.databasetest.model;

import android.content.ContentValues;

import java.io.Serializable;

/**
 * Created by zhoux on 2017/12/11.
 * 注释：
 */

public class UserModel implements Serializable {
    public ContentValues toContentValues() {//返回一个ContentValues 、更新、插入时候用到
        ContentValues cv = new ContentValues();
        cv.put(Columns.NAME, name);
        cv.put(Columns.AGE, age);
        return cv;
    }


    public static class Columns {//对应数据库的列名
        public static final String _ID = "_id";//主键
        public static final String NAME = "NAME";//姓名
        public static final String AGE = "AGE";//年龄
    }

    public long _id;
    public String name;
    public int age;

    @Override
    public String toString() {
        return "UserModel{" +
                "_id='" + _id + '\'' +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    interface TestInterface {
        void test();
    }
}
